Django for APIs by William S. Vincent

Django for APIs by William S. Vincent

Author:William S. Vincent [William S. Vincent]
Language: eng
Format: epub
Publisher: leanpub.com
Published: 2018-02-27T00:00:00+00:00


Django REST Framework + React

Now let’s hook into our Todo API for real instead of using the mock data in the list variable. In the other command line console our Django server is running and we know the API endpoint listing all todos is at http://127.0.0.1:8000/api/. So we need to issue a GET request to it.

There are two popular ways to make HTTP requests: with the built-in Fetch API or with axios, which comes with several additional features. We will use axios in this example. Stop the React app currently running on the command line with Control+c. Then install axios.

Command Line $ npm install axios



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.